package com.bus.core.manager;

import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Map;

import javax.mail.MessagingException;

import com.bus.common.email.EmailSender;
import com.bus.common.email.MessageTemplate;
import com.bus.core.entity.BusUser;
import com.bus.core.entity.BusUserExt;

public interface BusUserMng {
	
	
	

	public BusUser findById(Integer id);

	public BusUser findByUsername(String username);

	public BusUser registerMember(String username, String email,
			String password, String ip, Integer groupId,Integer grain, boolean disabled,BusUserExt userExt,Map<String,String>attr);
	
	public BusUser registerMember(String username, String email,
			String password, String ip, Integer groupId, boolean disabled,BusUserExt userExt,Map<String,String>attr, Boolean activation , EmailSender sender, MessageTemplate msgTpl)throws UnsupportedEncodingException, MessagingException ;

	public void updateLoginInfo(Integer userId, String ip,Date loginTime,String sessionId);

	public void updateUploadSize(Integer userId, Integer size);
	
	public void updatePwdEmail(Integer id, String password, String email);

	public boolean isPasswordValid(Integer id, String password);

	public BusUser deleteById(Integer id);

	public BusUser[] deleteByIds(Integer[] ids);

	public boolean usernameNotExist(String username);
	
	public boolean usernameNotExistInMember(String username);

	public boolean emailNotExist(String email);

}